<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
<h:head>
<title>SIMADM - Software de simulação Empresarial</title>
<link href="templatemo_style.css" rel="stylesheet" type="text/css" />
</h:head>


<h:body>
<div id="templatemo_body_wrapper">
	<div id="templatemo_wrapper">
    	
        <div id="templatemo_header">
            <div id="site_title"><h1><a href=""></a></h1></div>
            <div id="templatemo_menu">
                <ul>
                  <li><a href="Inicio2.xhtml" class="current">Início</a></li>
                  <li><a href="cadastros.xhtml">Cadastros</a></li>
                  <li><a href="modelos.xhtml">Modelos</a></li>
                  <li><a href="contact.html" class="last">Contato</a></li>
                </ul>
            </div> <!-- end of templatemo_menu -->
        </div><!-- end of header -->
        
        <div id="templatemo_middle">
            <div id="mid_left">
                <div id="mid_title">Sistema de Simulação Empresarial</div>
            </div>
            
        </div> <!-- end of middle -->
        
        <div id="templatemo_main">
        
        	<center>
<h:form>
<p:dataTable id="tabela" var="turmas" value="#{turmasMB.turmas}">
	<p:column headerText="Modelos">
		<p:selectOneMenu value="#{turmasMB.nomeModelo}" effect="fade">
            <f:selectItems value="#{turmas.modelos}" var="m" itemLabel="#{m.descricao}" itemValue="#{m.descricao}"/>
            <f:ajax><f:setPropertyActionListener target="#{turmasMB.setNomeModelo()}" value="#{m.descricao}" /></f:ajax>
        </p:selectOneMenu>  
	</p:column>
	<p:column headerText="Descrição">
		#{turmas.descricao}
	</p:column>
	<p:column headerText="Curso">
		#{turmas.curso}
	</p:column>
	<p:column>
		<h:outputText value="Senha: " />
		<h:inputText value="#{modeloSelecionadoBean.cod}" />
		<p:commandButton value="Entrar" action="#{modeloSelecionadoBean.getPag()}" ajax="false">
		 <f:setPropertyActionListener value="#{turmasMB.modeloSelecionado}" target="#{modeloSelecionadoBean.model}" />
		 <f:setPropertyActionListener value="#{turmas.codigoAcesso}" target="#{modeloSelecionadoBean.codAcesso}" />
		</p:commandButton>
	</p:column>
</p:dataTable>
</h:form>
</center>
<br/>
<h:outputText value="#{modeloSelecionadoBean.erro}" style="color: red;" />
            
          
            
        </div> <!-- end of main -->
    
    </div>
</div>
<br></br>
<div id="templatemo_footer_wrapper">
    <div id="templatemo_footer">
        Copyright © 2013 <a href="#">IFRN</a>
        <div class="cleaner"></div>
    </div>
</div>

</h:body>   
   
   
   
   
</html>